package com.redepronik.medisys.cithis.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the antecedentealergias database table.
 * 
 */
@Entity
@Table(name="antecedentealergias")
@NamedQuery(name="Antecedentealergia.findAll", query="SELECT a FROM Antecedentealergia a")
public class AntecedenteAlergia implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ANTECEDENTEALERGIAS_ANTECEDENTEALERGIAID_GENERATOR" )
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ANTECEDENTEALERGIAS_ANTECEDENTEALERGIAID_GENERATOR")
	@Column(unique=true, nullable=false)
	private Long antecedentealergiaid;

	@Temporal(TemporalType.DATE)
	@Column(nullable=false)
	private Date fecha;

	//bi-directional many-to-one association to Alergia
	@ManyToOne
	@JoinColumn(name="alergiaid", nullable=false)
	private Alergia alergia;

	//bi-directional many-to-one association to Paciente
	@ManyToOne
	@JoinColumn(name="pacienteid", nullable=false)
	private Paciente paciente;

	public AntecedenteAlergia() {
	}

	public Long getAntecedentealergiaid() {
		return this.antecedentealergiaid;
	}

	public void setAntecedentealergiaid(Long antecedentealergiaid) {
		this.antecedentealergiaid = antecedentealergiaid;
	}

	public Date getFecha() {
		return this.fecha;
	}

	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}

	public Alergia getAlergia() {
		return this.alergia;
	}

	public void setAlergia(Alergia alergia) {
		this.alergia = alergia;
	}

	public Paciente getPaciente() {
		return this.paciente;
	}

	public void setPaciente(Paciente paciente) {
		this.paciente = paciente;
	}

}